Mechanism for converting one type of mirror to another type of mirror on a storage system without transferring data

ABSTRACT

Embodiments of the present invention provide a mechanism for converting an existing mirror relationship between an original dataset at a source storage system and a copy of the original dataset at a destination system to a new mirror without discarding the existing copy of the original dataset and without transferring data to create a new dataset to replace the copy of the original dataset at the destination storage system. Rather, a directory structure (including file attributes) of the source storage system is transferred to the destination storage system and a comparison is made to identify file attributes at the destination system that match the transferred file attributes. If a match is found, a mapping between the matched file attributes is created. Subsequent updates to the destination storage system can be done using a technique other than the one that was used to create a copy of the source dataset.

FIELD OF THE INVENTION

This invention relates to storage of data, and more particularly to mirroring or replication of stored data.

BACKGROUND

A storage system is a processing system adapted to store and retrieve data on behalf of one or more client processing systems (“clients”) in response to external input/output (I/O) requests received from clients. A storage system can provide clients with a file-level access to data stored in a set of mass storage devices, such as magnetic or optical storage devices or tapes. A storage system can also provide clients with a block-level access to stored data, or with both a file-level access and block-level access.

Data storage space has one or more storage “volumes” comprising physical storage devices, defining an overall logical arrangement of storage space. The devices within a volume are typically organized as one or more groups of Redundant Array of Independent (or Inexpensive) Devices (RAID).

To improve reliability and facilitate disaster recovery in the event of a failure of a storage system, its associated devices or some portion of the storage infrastructure, it is common to replicate some or all of the underlying data and/or the file system that organizes the data. In one example, a replicated copy is created and stored at a remote site, making it more likely that recovery is possible in the event of a disaster that may physically damage the main storage location or its infrastructure (e.g., a flood, power outage, etc). As used herein, the terms “source site” and “source storage system” are used interchangeably. Similarly, the terms “remote site”, “destination site”, and “destination storage system” are used interchangeably. Various mechanisms are used to create a copy of a dataset (such as a file system, a volume, a directory, or a file) at a remote site. One prior art solution stores a file system and data of the source storage system onto a media and restores the stored data at the destination site (this approach is known as “seeding”). As new data are written to a source, data stored at the destination storage system lags behind in time. Thus, the destination storage system needs to be periodically updated to reflect incremental updates to the source system (e.g., updates occurring over periodic time intervals). In order to maintain a current copy of the data at the destination site, several approaches have been advanced. According to one approach, known as a full-backup method, a file system and associated data at the source storage system are entirely recopied to a remote (destination) site over a network after a certain time interval. This approach, however, may be inconvenient in situations where the size of the file system is measured in tens or hundreds of gigabytes (even terabytes). This full-backup approach may severely tax the bandwidth of the network as well as processing capabilities of both destination and source storage system.

According to another approach, a file system and associated data at the destination site are incrementally updated to reflect the most recent changes. Dumping data to a tape or any other media, however, does not support incremental updates that are infinite (e.g., updates that have no limitations on a number). At some point, all data on a source storage system need to be recopied over to a media. In addition, to ensure that the file system and associated data at the destination site are consistent with the source, access to the file system has to be temporarily halted during the process of copying data. Furthermore, the copy of the data has to remain a “read-only” copy so that it cannot be modified by a user.

To address these challenges, new solutions have been advanced that are capable of doing incremental updates infinitely. One common form of updates involves the use of a “snapshot” process in which the active file system (e.g., a file system to which data can be both written and read) at the storage site is captured and the “snapshot” is transmitted as a whole, over a network to the remote storage site. A snapshot is a persistent point in time (PPT) image of the active file system that enables quick recovery of data after data has been corrupted, lost, or altered. Snapshots can be created by copying the data at each predetermined point in time to form a consistent image, or virtually, by using a pointer to form the image of the data. One of the products that establishes and maintains mirror relationship between a source system and a destination system and provides infinite updates to the destination storage system using snapshots is SnapMirror®, a product provided by Network Appliance, Inc., Sunnyvale, Calif. The copy is updated at regular intervals, typically set by an administrator, by sending incremental changes in the most current snapshot since a previously copied snapshot, in an effort to capture the most recent changes to the file system.

There are two known types of mirrors—a physical mirror and a logical mirror. As used herein, the term “mirror” refers to a copy or a replica of a dataset. In a physical mirror, a copy created at the destination storage system has a physical layout that matches the physical layout of the dataset stored at the source storage system (i.e., a destination dataset is stored at data blocks that have the same physical addresses as data blocks that store a source dataset). In a logical mirror, in contrast, a destination dataset can be stored at the destination storage system at different physical locations than the source dataset.

Currently, if a mirror of the data at the source storage system has already been created at a destination site using one technique for mirroring data, and the updates to the mirror at the destination storage system are performed using another technique for mirroring data, an existing mirror at the destination storage system has to be discarded and a new mirror needs to be created. This procedure presents several disadvantages. First, it incurs extra storage space since a new copy of the data at the destination storage system needs to be created while the existing copy already exists. In addition, deleting an existing copy presents disruption to a user. Furthermore, to create a new copy at the destination storage system, a large amount of data needs to be transmitted over the network, thereby burdening the network.

Accordingly, what is needed is a mechanism that supports conversion of one mirror relationship to another mirror relationship without burdening the network bandwidth and without presenting disruption to the user.

SUMMARY

Embodiments of the present invention provide a system, method, and computer program product for converting an existing mirror relationship between an original dataset at a source storage system and a copy of the original dataset at a destination storage system to a new mirror relationship without discarding the existing copy of the original dataset, and thus, not creating a new copy of the original dataset at the destination storage system. Advantageously, the present invention does not incur extra storage space since the dataset at the destination storage system (also referred to herein as a destination dataset) is not discarded when a new mirror relationship is created. Furthermore, no disruption is presented to a user. In addition, by not transferring data from the source storage system to the destination storage system, the present invention does not burden the network with an extra traffic. Notably, the present invention can convert a physical mirror to a logical mirror or a logical mirror to another logical mirror without causing disruption to a user.

As used herein, “converting one mirror relationship to a new mirror relationship” refers to a process by which a physical mirror is converted to a logical mirror, or a logical mirror created using one technique is converted to a logical mirror that will be updated using a different technique.

According to an embodiment of the present invention, a directory structure of a file system (containing file and directory attributes) at the source storage system is transferred to the destination storage system. A directory can be transferred at any time as desired by a user. For example, the transfer may take place during off-peak hours when less workload at the storage system is expected. Alternatively, the transfer can take place at any time. As used herein, the word “file” encompasses a container, an object, or any other storage entity. The destination storage system, in turn, compares the received directory and file attributes to the directory and file attributes at the destination storage system. If a matching file attribute is found, a data structure is created that maps an identifier of the file at the source storage system to an identifier of a file having a matching attribute at the destination storage system. As a result, subsequent updates to the destination storage system can be done using a mirroring technique (which may support a logical mirror) other than the one that was used to create the existing mirror of the original dataset. As used herein, attributes may refer to file names, as well as other properties of a file.

Furthermore, the present invention can be implemented in a Storage Area Network (SAN) environment in which clients access data using block-based access requests, and clients see data as one or more logical units rather than a collection of files. According to this embodiment, rather than transferring attributes of files and directories to the destination storage system, an attribute of a logical unit(s) is transferred. The destination storage system compares the transferred attribute of a logical unit (LU) to an attribute of a logical unit at the destination storage system and creates a mapping between the attributes of the matching logical units. The mapping can be stored in a data structure at the destination storage system. Advantageously, a logical unit that was originally created at the destination storage system does not need to be disconnected from the destination system. As a result, no data is transferred over the network.

Furthermore, a novel technique of the present invention is not limited by mirroring data remotely. In contrast, the technique is applicable to creating a new type of mirror between one or two volumes that stores data for the source storage system.

Other aspects of the invention will become apparent from the following detailed description taken in conjunction with the accompanying drawings, which illustrate the principles of the invention by way of example.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic block diagram of a source storage system and a destination storage system;

FIG. 2 is a schematic block diagram of an exemplary storage operating system for use with the storage system of FIG. 1;

FIG. 3 is a schematic block diagram of an exemplary file system inode structure;

FIG. 4 is a schematic block diagram of the components executed at the source storage system and the destination storage system shown in FIG. 1 to implement the present invention;

FIG. 5 is an event diagram of a method for converting one mirror relationship to another mirror relationship according to an embodiment of the present invention;

FIG. 6A is an exemplary file system directory structure of a snapshot at the source storage system shown in FIG. 1;

FIG. 6B is an exemplary file system directory structure of an active file system at the destination storage system shown in FIG. 1;

FIG. 7 is an exemplary inode map according to an embodiment of the present invention;

FIG. 8 is an event diagram of a method for performing incremental updates at the destination storage system shown in FIGS. 1 and 4 according to an embodiment of the present invention; and

FIG. 9 is an event diagram of a method for converting one mirror relationship to another mirror relationship according to another embodiment of the present invention.

DETAILED DESCRIPTION Network and Storage System Environment

FIG. 1 is a schematic block diagram of a storage system environment that includes a pair of interconnected storage systems including a source storage system 110 and a destination storage system 112 that may be advantageously used with the present invention. For the purposes of this description, the source storage system 110 is a device that manages storage of one or more source volumes 114, each having an array of storage devices 160 (described further below). The destination storage system 112 manages one or more destination volumes 116, which, in turn, comprise arrays of storage devices 160 (such as disks). The source and destination storage systems are connected via a network 118 that can comprise a local or wide area network. For the purposes of this description, like components in each of the source and destination storage system, 110 and 112, respectively, are described with like reference numerals. As used herein, the term “source” can be broadly defined as a location from which data travels and the term “destination” can be defined as the location to which the data travels. Those of skill in the art would understand that although the present invention will be described in the context of creating a new mirror relationship at the destination storage system that is remotely located from the source storage system, in other embodiments, the new mirror relationship is created between one or more volumes that store data for the source storage system. As such, a volume that stores an original dataset is a source volume and a volume that stores a copy of the original dataset is a destination volume.

According to an embodiment of the present invention, in order to improve reliability and facilitate disaster recovery in the event of a failure of the source storage system 110, its associated storage devices or some portion of the storage infrastructure are mirrored at the destination storage system 112. A dataset is a set of data. Examples of datasets include, e.g., a file system, a volume, a directory, or a file. The term “mirroring” refers to the process of creating a copy or a replica of a dataset. The original dataset is also called a “source dataset” with respect to the mirror. The mirror at the destination storage system could have been created using several known mechanisms, such as a Network Data Management Protocol (NDMP) (an open standard protocol for enterprise-wide backup of heterogeneous network-attached storage), a Robocopy protocol, a VolCopy command provided by Network Appliance of Sunnyvale, Calif., or a SnapMirror® application. Mirroring or replication of stored data in remote storage locations over a network is described in detail in a commonly-owned U.S. patent application Ser. No. 10/100,950, entitled “System and Method For Asynchronous Mirroring of Snapshots At a Destination using a Purgatory Directory and Inode Mapping,” by Stephen L. Manley, et al., which disclosure is incorporated by reference herein.

Conventionally, to convert an existing mirror relationship to a new mirror relationship between a source dataset stored at the source storage system and a destination dataset stored at the destination storage system, the existing relationship would have to be discarded (by deleting a mirror at a destination storage system) and a new copy of a dataset needs to be created at the destination storage system. As described herein, this, in turn, incurs extra storage space and processing since there is a need to recreate the source data at the destination. In addition, since data from the source storage system needs to be transferred to the destination storage system, the transfer uses network bandwidth. According to an embodiment of the present invention, an existing mirror relationship is converted to a new mirror relationship without discarding an existing copy at the destination storage system. This, in turn, eliminates the need to create a new copy of a dataset at the destination storage system, and thus to transfer large amount of data over the network. As will be described in greater detail herein, according to an embodiment of the present invention, rather than creating a new copy of the active file system at the destination storage system, the present invention transfers a directory structure (such as directory and file attributes) to the destination storage system. The destination storage system compares the directory and file attributes to directory and file attributes of the active file system at the destination storage system. If a matching file attribute is found at the destination file system, a mapping is created between the inode number of the source file and the inode number of the destination file whose attributes match to create a new relationship that can be used instead of the prior relationship. The mapping is stored at the destination storage system for later use. An inode is a data structure persistent on a storage device that stores information about a file, such as ownership of the file, access permission for the file, size of the file, name of the file, location of the file, as well as other attributes of a file. Future updates to the destination storage system can be done using a mirroring technique other than the one that was used to create a mirror relationship in the first place, yet the existing copy at the destination storage system need not be discarded and can be used to provide subsequent updates. A person of ordinary skill in the art would understand that although the present invention can be implemented in the context of transferring directories and file names, other attributes of files can be used to implement the present invention. Furthermore, the present invention can be implemented in a SAN environment so that attributes of directories and logical units are transferred to the destination storage system.

Still referring to FIG. 1, storage systems 110 and 112 can be any type of special-purpose computer (e.g., server) or general-purpose computer, including a standalone computer. The source and destination storage systems 110, 112 each comprise a processor 120, a memory 125, a network adapter 130 and a storage adapter 140 interconnected by a system bus 145. Each storage system 110, 112 also include a storage operating system 200 (shown in more detail in FIG. 2) that implements a file system to logically organize the information as a hierarchical structure of directories and files on storage devices.

It will be understood to those skilled in the art that the inventive technique described herein may apply to any type of special-purpose computer or general-purpose computer, including a standalone computer, embodied as a storage system. Moreover, the teachings of this invention can be adapted to a variety of storage system architectures including, but not limited to, a network-attached storage environment, a storage area network and disk assembly directly-attached to a client/host computer. The term “storage system” should, therefore, be taken broadly to include such arrangements.

In the illustrative embodiment, the memory 125 comprises storage locations that are addressable by the processor and adapters for storing software program code. The memory can be a random access memory (RAM). The processor and adapters may, in turn, comprise processing elements and/or logic circuitry configured to execute the software code and manipulate the data structures stored in memory. The operating system 200, portions of which are typically resident in memory, functionally organizes the storage system by, inter alia, invoking storage operations in support of a file service implemented by the storage system. It will be apparent to those skilled in the art that other processing and memory means, including various computer readable media, may be used for storing and executing program instructions pertaining to the inventive technique described herein.

The network adapter 130 comprises the mechanical, electrical and signaling circuitry needed to connect each storage system 110, 112 to the network 118, which may comprise a point-to-point connection or a shared medium, such as a local area network.

The storage adapter 140 cooperates with the operating system 200 executing on the storage system to access information requested by the client (such as client 170). The information may be stored on the storage devices 160 that are attached, via the storage adapter 140 to each storage system 110, 112 or other node of a storage system as defined herein.

Each storage system 110 and 112 may also be interconnected with one or more clients 170 via the network adapter 130. The clients transmit requests for data to the source and destination storage systems 110, 112, respectively, and receive responses to the requests over a LAN or other network (e.g., 118). Data is transferred between the client and the respective storage system 110, 112 using data packets 155 defined as an encapsulation of the Common Internet File System (CIFS) protocol or another appropriate protocol such as Network File System (NFS) protocol.

In one exemplary implementation, each storage system 110, 112 can include a nonvolatile random access memory (NVRAM) 135 that provides fault-tolerant backup of data, enabling the integrity of storage system transactions to survive a service interruption based upon a power failure, or other fault. The size of the NVRAM depends in part upon its implementation and function in the storage system. It is typically sized sufficiently to log a certain time-based chunk of transactions.

In an illustrative embodiment, the storage devices 160 are arranged into a plurality of volumes (for example, source volumes 114 and destination volumes 116), in which each volume has a file system associated therewith. The volumes each include one or more devices 160. In one embodiment, storage devices 160 are configured into RAID groups so that some devices store striped data and some devices store separate parity for the data, in accordance with a preferred RAID-4 configuration. However, other configurations (e.g. RAID-5 having distributed parity across stripes, or RAID-DP) are also contemplated.

Storage Operating System

Referring now to FIG. 2, to facilitate generalized access to the storage devices 160, the storage operating system 200 (FIG. 2) implements a write-anywhere file system 285 that logically organizes the information as a hierarchical structure of directories and files on the storage devices (such as the one shown in FIGS. 6A and 6B and described in more detail herein). Each file may be implemented as a set of blocks configured to store information, such as data, whereas the directory may be implemented as a specially formatted file in which references to other files and directories are stored. The storage operating system can be NetApp® Data ONTAP™ operating system available from Network Appliance, Inc., of Sunnyvale, Calif., that implements the Write Anywhere File Layout (WAFL™) file system. Those skilled in the art, however, would understand that any appropriate file system that is otherwise adaptable to the teachings of this invention can be used. As used herein, the term “storage operating system” generally refers to the computer-executable code operable on a computer to perform a storage function that manages data access and may, in the case of a storage system 200, implement data access semantics of a general purpose operating system. The storage operating system can also be implemented as a microkernel, an application program operating over a general-purpose operating system, such as UNIX® or Windows NT®, or as a general-purpose operating system with configurable functionality, which is configured for storage applications as described herein.

Generally, file system 285 has format representation that is block-based (e.g., 4-kilobyte (KB) data blocks). Inodes can be used to describe the files. When servicing client requests for data, the file system generates operations to load (retrieve) the requested data from devices 160 if data are not resident in the storage system's memory. If the data are not in memory, the file system layer 285 indexes into the inode file (shown in FIG. 3) using the inode number to access an appropriate entry and retrieve a volume block number. The file system 285 then passes the volume block number to a storage (RAID) subsystem 260, which maps that volume block number to a device block number and sends the latter to an appropriate driver (for example, an encapsulation of SCSI implemented on a fibre channel device interconnection) of a driver subsystem 265. The driver subsystem 265 accesses the block number from volumes and loads the requested data in memory 125 for processing by the storage system 110, 112. Upon completion of the request, the storage system (and storage operating system) returns a reply, to the client 170.

It should be noted that the software “path” through the storage operating system layers described above needed to perform data storage access for the client request received at the storage system may alternatively be implemented in hardware or a combination of hardware and software.

The storage operating system 200 comprises a series of software layers, including a network driver layer (e.g., an Ethernet driver), a network protocol layer (e.g., an Internet Protocol layer and its supporting transport mechanisms, the Transport Control Protocol layer and the User Datagram Protocol layer), as well as a file system protocol server layer (e.g., a CIFS server, a NFS server, etc.) organized as a network protocol stack 210. The storage subsystem 260 that implements a storage protocol, such as a RAID protocol, and the driver subsystem 265 implements a control protocol such as the small computer system interface (SCSI).

Referring now to FIG. 3, an exemplary file system inode structure 300 according to an illustrative embodiment is shown in FIG. 3. The inode for the inode file or more generally, the “root” inode 305 contains information describing the inode file 308 associated with a given file system. In this exemplary file system, inode structure root inode 305 contains a pointer to the inode file indirect block 310. The inode file indirect block 310 points to one or more inode file direct blocks 312, each containing a set of pointers to inodes 315 that make up the inode file 308. The depicted subject inode file 308 is organized into volume blocks (not separately shown) made up of inodes 315, which, in turn, contain pointers to file data blocks 320A, 320B and 320C. Each of the file data blocks 320(A-C) is adapted to store, in the illustrative embodiment, 4 kilobytes (KB) of data.

Referring again to FIG. 2, overlying the file system layer 285 is a conversion module 297 in accordance with an illustrative embodiment of the present invention. Components of the conversion module 297 are implemented at the source storage system 110 and the destination storage system 112. For purposes of the present invention, components of the conversion module at the source storage system 110 are designated as conversion module 297 a, and components of the conversion module at the destination storage system 112 are designated as conversion module 297 b (these components are shown in FIG. 4). Briefly, as part of the process for converting an existing mirror relationship between a source dataset and a destination dataset to a new mirror relationship, conversion module 297 a at the source storage system 110 is responsible for traversing a file directory structure of a snapshot of the active file system, identifying directories and files, and transferring attributes of the directories and files to conversion module 297 b at the destination storage system 112. Conversion module 297 b at the destination storage system 112, in turn, receives directory and file attributes from the source storage system and compares the attributes to the directory and file attributes at the destination storage system. For each matched entry, conversion module 297 b creates a mapping between the matched attributes of files and/or directories using inode numbers identifying files and directories. Once the map (such as inode map 299 shown in FIG. 4 and FIG. 7) is built between file and directory structure at the source storage system and the file and directory structure at the destination storage system, future updates to the data at the source storage system 110 can be provided at the destination system using the map.

The mirroring (or replication) application 295 (also referred to herein as “mirroring module”) in accordance with an illustrative embodiment of this invention is responsible for updating a destination dataset (or a mirror) at the destination storage system 112. Components of the mirroring module 295 are executed both at the source storage system 110 and destination storage system 112. For purposes of the present invention, components of the mirroring module 295 executed at the source storage system 110 are designated as mirroring module 295 a. Components of the mirroring module 295 executed at the destination storage system 110 are designated as mirroring module 295 b. Mirroring module 295 a is responsible (on the source side) for identifying changes between a base snapshot (the most recent snapshot transferred successfully) and a current snapshot of the source file system and transferring the changes to the destination storage system 112 over the network. Notably, according to an embodiment of the present invention, the updates to the source storage system 110 can be mirrored at the destination storage system using a technique other than the one that was used to create the existing mirror, without discarding the existing mirror at the destination storage system 112. The mirroring module 295 b at the destination storage system 112 is responsible for updating a dataset at the destination storage system 112. A mechanism for performing incremental updates at the destination storage system after the existing mirror relationship has been converted to a new mirror relationship will be described in greater detail in reference to FIG. 8.

Referring now to FIG. 6A, it illustrates an exemplary hierarchical structure 600 of linked nodes which represent directories and files of a base snapshot created at the source storage system 110. Those skilled in the art would understand that other structures can be used. In this structure, nodes A, B, and C represent directories. Nodes “d”, “f” and “g” are files within directory B, nodes “h” and “k” are files within directory C. The topmost node in this structure is node A (root node). The remaining nodes are child nodes of node A. Nodes d, f, g, h, and k are called leaf nodes since neither of these nodes has a child. Each node corresponding to a file has an inode number associated with that file.

Referring now to FIG. 5, it illustrates various communications between conversion module 297 a and conversion module 297 b to implement mechanism for converting an existing mirror relationship between a source dataset and a destination dataset to a new mirror relationship. An embodiment of the present invention provides for conversion of a physical mirror to a logical mirror and/or for conversion of one logical mirror to another logical mirror. As previously described, in a logical mirror type relationship, a destination dataset is independent of a physical layout of the source dataset. That is, the destination dataset can be stored at the destination storage system at a different physical location on storage devices connected to the destination storage system 112 than the original dataset stored on the device connected to the source storage system 110. As a result, relationship between the source dataset and destination dataset can be established by a logical mapping. In a physical mirror type relationship, in contrast, the source dataset is stored at the same physical address at the source storage system 110 as the mirror at the destination storage system 112 so that access can be had to both datasets using the same physical addresses.

Initially, at step 510, mirroring module 295 a creates a base snapshot of the active file system at the source storage system 110. The process of creating snapshots is described in U.S. patent application Ser. No. 10/090,963, entitled “System and Method for Creating a Point-in-time Restoration of Database File,” by Dennis Chapman, the contents of which are incorporated by reference herein.

Mirroring module 295 a then transfers snapshot information related to the created base snapshot. The information may include, for example, a snapshot identification (ID), a timestamp indicating when the snapshot was created, as well as other information related to the created snapshot. Mirroring module 295 b at the destination storage system 112 receives 520 the snapshot information and optionally stores it in memory, e.g., memory 125, at the destination storage system 112.

At step 530, conversion module 297 a traverses a directory structure (such as data structure 600 shown in FIG. 6A) to identify directory and file attributes from the base snapshot. According to an embodiment of the present invention, conversion module 297 a visits each node in the structure (i.e., traverses the structure) to identify nodes that represent directories and places these nodes into a processing queue. Various algorithms can be used to traverse a hierarchical structure to identify nodes that represent directories. These algorithms can differ in the order in which the nodes are visited. In one implementation, a breadth-first search (BFS) algorithm is used to traverse the data structure. Briefly, using this method, the traversal of the structure begins at the root and explores all the neighboring nodes. A neighboring node is a node that is connected to a node that is being traversed. Then for each of those nearest nodes, it explores their unexplored neighbor nodes, and so on, until there are no more nodes in the structure. The following steps describe the BFS algorithm as used in the present invention to traverse directory structure 600 shown in FIG. 6A:

1. Put the root node in the queue (e.g., node A);

2. Pull a node from the beginning of the queue and examine it (e.g., node A);

3. If the node is a directory node and there are no more nodes in the structure, stop the traversal;

4. Otherwise push all the (so-far-unexamined) successors of this node (e.g., nodes B and C) into the end of the queue, if there are any;

5. If the queue is empty, every node in structure has been examined—discontinue the search and return “not found”;

6. Repeat from Step 2.

As a result of traversing structure 600 using the BFS algorithm, the queue will include the following directory nodes: A, B, and C. According to other embodiments, the traversal of the structure can be performed using a depth-first-search (DFS) algorithm. A person of ordinary skill in the art would understand that other algorithms that produce similar results can be used to traverse a hierarchical data structure.

After performing the search, conversion module 297 a identifies attributes of files for each directory node and transfers the file attributes (at step 540) to the destination storage system 112. In one implementation, the attributes are transferred using, for example, a known logical replication protocol (LREP). Notably, the transfer can take place at any time as desired by a user. For example, the transfer may take place during off-peak hours when less workload at the storage system is expected. Alternatively, the transfer can take place at any other time.

Using an exemplary directory structure in FIG. 6A, conversion module 297 a transfers to the destination storage system attributes for the following files and directories:

Directory B: file d, file f, file g;

Directory C: file h, file k.

Other properties of the file can also be transferred to the destination storage system 112. These properties may include inode numbers of files and directories, an extension of the inode, which indicates a version of the file, a timestamp indicating when a file was created, as well as other attributes.

Still referring to FIG. 5, conversion module 297 b at the destination storage system 112 receives attributes of files and directories, at step 550. Optionally, conversion module 297 b stores the received file attributes in a temporary file in memory (such as memory 125) at the destination storage system 112. In one exemplary embodiment, transferred attributes are added to a hash table in memory. Those skilled in the art would understand that other data structures can be used. Each entry in the hash table, thus, represents a transferred directory or file attribute. Those of skill in the art would understand that a hash table is one exemplary mechanism for implementing the present invention, and other techniques that produce similar results can be used.

Conversion module 297 b traverses the hash table and compares each entry corresponding to the transferred directory or file attribute to file and directory attributes in a directory structure of the active file system at the destination storage system 112 (step 560). Such an exemplary hierarchical structure 600′ of directories and files in the active file system of the destination storage system 112 in shown in FIG. 6B. In this structure, nodes A, B, and C represent directories. Nodes “d”, “f” and “g” are files within directory B, nodes “h” and “k” are files within directory C. The topmost node in this structure is node A (a root node). The remaining nodes are child nodes of node A. Nodes d, f, g, h, and k are called leaf nodes since neither of these nodes has a child. Each node corresponding to a file has an inode number associated with that file. As illustrated in FIGS. 6A and 6B, although both figures depict the same file attributes and directories, inode numbers that correspond to the files at the source storage system 110 (in FIG. 6A) are different from those corresponding to the files at the destination storage system (in FIG. 6B).

In one exemplary embodiment, the conversion module 297 b starts traversing the directory structure at the root of the active file system at the destination storage system 112, and loads all the file and directory attributes to memory 125. If a match is found for an attribute in the hash table (at step 570), conversion module 297 b removes the attribute of the file or directory from the table and adds inodes of the matched file attributes to the inode map created at the destination storage system 112 (step 580). An exemplary inode map that maps inode numbers of the source files and directories and destination files and directories is shown in FIG. 7. The inode map can be stored on storage devices 160 at the destination storage system 112.

Referring now to FIG. 7, an inode map (such as inode map 299) is established in the destination storage system 112. The inode map 299 comprises a plurality of entries. Each entry 702 includes a source inode number 704 (corresponding to the file from the source storage system) and a destination inode number 706 (corresponding to the file from the destination storage system). In addition, an entry 702 may include a source generation number 708, which represents a version of the file having the source inode number. Entry 702 may also include a destination generation number 710, which represents a version of the file having the destination inode number.

As matching file and directory attributes are found at the destination storage system, the inode map is populated with inode numbers corresponding to the matching attributes. As will be described in more detail below, once the map is built, future updates to the source storage system 110 can be made using the inode map without creating a new copy of the source dataset. As previously described, known techniques for creating a new mirror relationship between a source dataset and a destination involve transferring actual file data, such as 4 KB data blocks, to the destination storage system, and discarding an existing destination dataset. By transferring attributes of the files and directories from the source storage system 110 to the destination storage system 112 and comparing the transferred attributes to the directory and file attributes maintained at the destination storage system 112, the present invention avoids transferring large amounts of data over the network when the data is already present at the destination storage system 112.

Still referring to FIG. 5, if a matching attribute is not found, it indicates that the file was deleted from the active file system at the destination storage system 112. In this situation, conversion module 297 b requests conversion module 297 a to transfer those files. Once the mapping between inodes is created, conversion module 297 b indicates at the destination storage system that a logical mirror was created. The logical mirror is marked as a “read-only.”

Inode Matching

According to another implementation, instead of creating an inode map, conversion module 297 b at the destination storage system 112, matches inodes on a destination storage system 112 to inodes at the source storage system 110. Referring again to FIGS. 6A and 6B to illustrate this embodiment. According to this embodiment, inode numbers at the destination storage system (such as inode numbers “248”, “250”, “252”, “276”, “278”, “280”, “284”, and “286”) are changed to match inode numbers associated with the matching files and directories at the source storage system 110 (such as inode numbers “102”, “104”, “106”, “120”, “121”, “122”, “123”, and “124”). To this end, when a matching file attribute is found at the destination storage system 112, conversion module 297 b copies the inode corresponding to the matching file, to a new location identified by the inode number of the file at the source storage system 110. A directory entry is also changed to indicate that the inode number has changed. As a result, matching file attributes at the destination storage system 112 will have the same inode numbers as their matching counterparts at the source storage system 110.

Referring now to FIG. 8, it describes communications between the source storage system 110 and the destination storage system 112 to replicate updates occurring at the source storage system, to the destination storage system, after a new mirror relationship has been created.

Initially, the source storage system 110 requests, from the destination storage system 112, information regarding the base snapshot (step 805). Mirroring module 295 b at the destination storage system 112 provides, to the source storage system 110, the requested information (such as a snapshot ID, a timestamp indicating when the snapshot was created, as well as other data related to the base snapshot) (at step 810).

Mirroring module 295 a at source storage system 110 uses the received information to determine whether the base snapshot is stored at the source storage system 110 (step 820). In one implementation, to this end, mirroring module 295 a uses a snapshot ID to find the snapshot identified by the snapshot ID. At step 830, a current snapshot is created. Mirroring module 295 a then identifies inodes that have changed since the base snapshot was created using, for example, an inode structure (such as the one shown in FIG. 3) (step 840). As described herein, an inode stores information about a file, such as ownership of the file, access permission for the file, size of the file, name of the file, location of the file, a timestamp indicating when a file was created, etc. In one implementation, mirroring module 295 a identifies changes in the inode by comparing the timestamp of the current snapshot and the timestamp of the base snapshot. If the two timestamps do not match, it indicates that the inode has changed since the base snapshot was created. Mirroring module 295 a puts all modified inodes into a queue and identifies data blocks (such as data blocks 320 shown in FIG. 3) corresponding to modified inodes (step 850). Mirroring module 295 a then sends, to destination storage system 112, inode numbers for modified inodes as well as data blocks corresponding to the modified inodes (step 860).

Mirroring module 295 b at destination storage system 112 receives source inode numbers and data blocks, and uses the inode map to identify destination inode numbers mapped to the source inode numbers. Then, new data blocks are written to the destination storage system 112 as part of the process for updating destination dataset at the destination storage system (step 870).

SAN Implementation

In a storage system that supports a Storage Area Network (SAN)-based network environment, clients usually access data at a storage system using block-based access protocols, such as the Small Computer Systems Interface (SCSI) protocol. Clients 170 see data as one or more logical units (LU) identified by a logical unit number, rather than a collection of files. When a commercially available application is used to create a copy of a LU at the destination storage system 112, client system (such as client 170) connected to both the source storage system and destination storage system 112 performs the replication. Conventionally, to convert an existing relationship between the source and destination storage systems, the copied LU would have to be disconnected from the destination storage system 112, and the LU at the source storage system would have to be copied again to the destination storage system 112 using the new relationship. Thus, conventional techniques require transfer of large amounts of data over the network and significant processor use to create a new copy of the LU at the destination storage system 112.

According to an embodiment of the present invention, conversion of an existing mirror relationship between the source storage system and destination storage system, to a new relationship can be done without disconnecting the existing copy of the LU. Such a conversion mechanism is described in greater detail in reference to FIG. 9.

Referring now to FIG. 9, initially, an attribute of the LU (such as name of the LU) at the destination storage system 112 is changed to that of the LU at the source storage system 112 (step 905). Then, mirroring module 295 a creates a base snapshot of the LU at the source storage system 110. Mirroring module 295 a transfers snapshot information related to the created base snapshot. The information may include, for example, a snapshot identification (ID), a timestamp indicating when the snapshot was created, as well as other data related to the created snapshot. Mirroring module 295 b at the destination storage system 112 receives 920 the snapshot information and optionally stores it in memory, e.g., memory 125, at the destination storage system 112. Conversion module 297 a then traverses a directory structure to identify a LU (step 930) and transfers to destination storage system 112 attribute(s) of a directory that maintains the LU as well as an inode number of the LU (step 940).

Conversion module 297 b at the destination storage system 112 receives the attribute of the directory and the attribute of the LU, at step 950. Optionally, conversion module 297 b stores the received attributes in a temporary file in memory (such as memory 125) at the destination storage system 112. Conversion module 297 b receives the attributes (step 950) and compares the received attributes of a directory and the LU from the source storage system to the attributes of a directory and LU in the active file system at the destination system (step 960). If the attributes match, conversion module 297 b creates an entry in an inode map (such as inode map 299 shown in FIG. 7) at the destination storage system 112 (step 980). Such an entry includes an inode number of the LU at the source storage system 110 and the inode number of the LU with a matching attribute at the destination storage system 112. Subsequent updates to the data blocks at the source storage system can be replicated to the data blocks at the destination storage system 112 using a technique different from the one that was used to create a copy of the LU at the destination system. Importantly, a copy of the LU that was originally created at the destination storage system 112 does not need to be disconnected from the destination system. As a result, no data is transferred over the network.

Thus, the present invention provides a novel mechanism for converting an existing mirror relationship (physical or logical) between a source storage system and a destination storage system to a new mirror relationship without discarding an existing mirror at the destination storage system.

A person of ordinary skill in the art would understand that although the present invention has been described in the context of transferring names and directories, other attributes of files and directories can be used to implement the present invention.

Although the present invention for purpose of explanation has been described with reference to specific exemplary embodiments, it will be understood that the invention is not limited to the embodiments described. A person of ordinary skill in the art would understand that the present invention can be practiced with modifications and alternations to those embodiments or can be practiced in other embodiments within the spirit and scope of the appended claims.

The embodiments were chosen and described in order to best explain the principles of the invention and its practical applications, to thereby enable others skilled in the art to best utilize the invention and various embodiments with various modifications as are suited to the particular use contemplated. Moreover, non-dependent acts may be performed in parallel. Furthermore, the use of the phrase “one embodiment” throughout does not necessarily mean the same embodiment. Unless specifically stated otherwise, terms such as “processing” or “computing” or “calculating” or “determining” or “displaying” or the like refer to the action and processes of a computer system or similar electronic computing device that manipulates and transforms data represented as physical (e.g. electronic) quantities within the computer systems registers and memories into other data similarly represented as physical quantities within the computer system.

The present invention can be implemented by an apparatus for performing the operations herein. This apparatus may be specially constructed for the required purposes or it may comprise a machine, such as a general-purpose computer selectively activated or reconfigured by a computer program (such as a collection of instructions for execution by a machine or processor for example) stored in the computer. Such a computer program may be stored in a computer readable storage medium, such as, but not limited to any type of storage device including floppy disks, optical disks, magnetic optical disks, read-only memories, random access memories, EPROMS, EEPROMS, magnetic or optical cards or any type of media suitable for storing physical (e.g. electronic) constructions and each coupled to a computer system bus. Each of these media may be coupled to a computer system bus through use of an appropriate device for reading and or for writing the media. 

What is claimed is:
 1. A method comprising: converting an existing mirror relationship between an original dataset stored at a source storage system and a mirror of the original dataset stored at a destination storage system to a new mirror relationship, a dataset including one or more data containers, the existing mirror relationship converted by: transferring, from a source conversion module on the source storage system, a first plurality of data container attributes contained on the source storage system's active file system in a directory structure, each attribute within the first plurality of data container attributes associated with a data container's properties, the first plurality data container attributes transferred to the destination storage system rather than the files themselves; receiving the first plurality of data container attributes at a destination conversion module on the destination storage system; comparing, by the destination conversion module on the destination storage system, the first plurality of data container attributes received in the directory structure to the attributes on the destination storage system's active file system to find common data container attributes contained on both the source storage system and the destination storage system; for each matching attribute found in both the first plurality of data container attributes and the second plurality of data container attributes, creating a mapping of an associated inode number on the source storage system to an associated inode number on the destination storage system of each data container associated with the matched attribute; and establishing a new mirror relationship using the mapping without discarding the mirror and without transferring data from the source storage system to create a new mirror to replace the existing mirror at the destination storage system.
 2. The method of claim 1, wherein a data container is a file.
 3. The method of claim 1, wherein a data container is a logical unit.
 4. The method of claim 1, wherein the existing mirror relationship is a physical mirror and the new mirror relationship is a logical mirror.
 5. The method of claim 1, wherein the existing mirror relationship is a logical mirror and the new mirror relationship is a logical mirror.
 6. The method of claim 1, wherein creating a mapping further comprises associating an inode of a data container at the source storage system with an inode of a data container having a matched attribute at the destination storage system.
 7. A method comprising: converting an existing mirror relationship between an original dataset stored at a source storage system and a copy of the original dataset stored at a destination storage system to a new mirror relationship, each dataset including one or more data containers, the existing mirror relationship converted by: transferring, from a source conversion module on the source storage system, a first plurality of data container attributes contained on the source storage system's active file system in a directory structure, each attribute within the first plurality of data container attributes associated with a data container's properties, the first plurality data container attributes transferred to the destination storage system rather than the files themselves; receiving the first plurality of data container attributes at a destination conversion module on the destination storage system; finding attributes of data containers at the destination storage system matching attributes of data containers at the source storage system by comparing the attributes received in the directory structure to the attributes on the destination storage systems active file system; for each matching attribute found in both the first plurality of data container attributes and the second plurality of data container attributes, changing identifiers of the data containers at the destination storage system having attributes that match the attributes of the data containers at the source storage system; and establishing the new mirror relationship between the original dataset and the copy of the original dataset without discarding the copy of the original dataset and without transferring data to create a new dataset to replace the copy of the original dataset at the destination storage system.
 8. The method of claim 7, wherein an identifier is an inode number identifying a data container and the changing step further comprises: copying an inode number of the data container having a matching attribute to a new location; and updating a directory structure to indicate the change of the inode number.
 9. A system for converting an existing mirror relationship between an original dataset stored at a source storage system and a copy of the original dataset stored at a destination storage system to a new mirror relationship, each dataset including one or more data containers, the system comprising: a first conversion module executed at the source storage system configured to transfer a first plurality of data container attributes contained on the source storage system's active file system in a directory structure, each attribute within the plurality of attributes associated with a data container's properties, the first plurality data container attributes transferred to the destination storage system rather than the files themselves; a second conversion module executed at the destination storage system configured to receive the first plurality of data container attributes at a destination conversion module on the destination storage system, to find attributes of data containers at the destination storage system matching the received attributes of data containers by comparing the first plurality of data container attributes received in the directory structure to attributes on the destination storage system's active file system, and for each matching attribute found in both the first plurality of data container attributes and the second plurality of data container attributes, to create a mapping between the data containers having matching attributes; and a first mirroring module at the destination storage system configured to provide updates to the copy of the original dataset to reflect changes in the original dataset using the mapping without discarding the copy of the original dataset and without transferring data from the source storage system to create a new dataset to replace the copy of the original dataset at the destination storage system.
 10. The system of claim 9, further comprising a second mirroring module at the source storage system configured to: create a current snapshot at the source storage system; identify modified data blocks; and provide, to the destination storage system, the modified data blocks.
 11. The system of claim 9, wherein the second conversion module is further adapted to create a mapping of an inode of a data container at the source storage system and an inode of a data container having a matching attribute at the destination storage system.
 12. The system of claim 9, wherein the first conversion module and the second conversion module each comprising program code executed on one or more processors of the storage system.
 13. The system of claim 9, wherein the first mirroring module comprises program code executed on one or more processors of the storage system.
 14. A computer-program product containing executable program instructions executed by a processor, comprising: a computer-readable medium having computer program code embodied thereon for converting an existing mirror relationship between an original dataset stored at a source storage system and a copy of the original dataset stored at a destination storage system to a new mirror relationship, each dataset including one or more data containers, the computer program code configured to: transfer, from a source conversion module on the source storage system, a first plurality of data container attributes contained on the source storage system's active file system in a directory structure, each attribute within the first plurality of data container attributes associated with a data container's properties, the first plurality data container attributes transferred to the destination storage system rather than the files themselves; receive the first plurality of data container attributes at a destination is conversion module on the destination storage system; compare, by the destination conversion module on the destination storage system, the first plurality of data container attributes received in the directory structure to attributes on the destination storage system's active file system to find common data container attributes contained on both the source storage system and the destination storage system; for each matching attribute found in both the first plurality of data container attributes and the second plurality of data container attributes, create a mapping of an associated inode number on the source storage system to an associated inode number on the destination storage system of each data container associated with the matched attribute; and establish a new mirror relationship using the mapping without discarding the copy of the original dataset and without transferring data from the source storage system to create a new dataset to replace the copy of the original dataset at the destination storage system.
 15. The computer program code of claim 14, wherein the existing mirror relationship is a physical mirror and the new mirror relationship is a logical mirror.
 16. The computer program code of claim 14, wherein the existing mirror relationship is a logical mirror and the new mirror relationship is a logical mirror. 